package com.ssy.wireless.web.vo.req;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by cofey on 16/11/20.
 */
public class UserAuthQueryVo {
    private String area;
    private String mobile;
    private String userName;
    private String hotspotName;
    private String authBeginTime;
    private String authEndTime;
    private String expireBeginTime;
    private String expireEndTime;

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getHotspotName() {
        return hotspotName;
    }

    public void setHotspotName(String hotspotName) {
        this.hotspotName = hotspotName;
    }

    public String getAuthBeginTime() {
        return authBeginTime;
    }

    public void setAuthBeginTime(String authBeginTime) {
        this.authBeginTime = authBeginTime;
    }

    public String getAuthEndTime() {
        return authEndTime;
    }

    public void setAuthEndTime(String authEndTime) {
        this.authEndTime = authEndTime;
    }

    public String getExpireBeginTime() {
        return expireBeginTime;
    }

    public void setExpireBeginTime(String expireBeginTime) {
        this.expireBeginTime = expireBeginTime;
    }

    public String getExpireEndTime() {
        return expireEndTime;
    }

    public void setExpireEndTime(String expireEndTime) {
        this.expireEndTime = expireEndTime;
    }

    public Map<String, Object> queryParams() {
        Map<String, Object> params = new HashMap();
        params.put("mobile", StringUtils.hasLength(this.getMobile()) ? "%" + this.getMobile() + "%" : null);
        params.put("hotspotName", StringUtils.hasLength(this.getHotspotName()) ? "%" + this.getHotspotName() + "%" : null);
        params.put("area", StringUtils.hasLength(this.getArea()) ? "%" + this.getArea() + "%" : null);
        params.put("authBeginTime", StringUtils.hasLength(this.getAuthBeginTime()) ? this.getAuthBeginTime() + " 00:00:00" : null);
        params.put("authEndTime", StringUtils.hasLength(this.getAuthEndTime()) ? this.getAuthEndTime() + " 23:59:59" : null);
        params.put("expireBeginTime", StringUtils.hasLength(this.getExpireBeginTime()) ? this.getExpireBeginTime() + " 00:00:00" : null);
        params.put("expireEndTime", StringUtils.hasLength(this.getExpireEndTime()) ? this.getExpireEndTime() + " 23:59:59" : null);
        return params;
    }
}
